import { defineStore } from 'pinia';

export default defineStore('page', () => {
  const parameters = ref<unknown>();
  const rpxRatio = computed(() => {
    const system = uni.getSystemInfoSync();
    return 750 / system.windowWidth;
  });

  const setParameters = (value: unknown) => {
    parameters.value = value;
  };

  const clearParameters = () => {
    parameters.value = undefined;
  };

  return {
    parameters,
    rpxRatio,
    setParameters,
    clearParameters
  };
});
